
import dto.CommandDto;
import impl.AnalysisXmlServiceDom4jImpl;
import impl.LinuxLinkServiceImpl;
import service.AnalysisXmlService;
import service.LinuxLinkService;
import toolkit.tianshi.common.model.Response;

public class xmlParsing {

    public void analysisXmlToModel(){
        AnalysisXmlService analysisXmlServiceImpl = new AnalysisXmlServiceDom4jImpl();
        CommandDto commandDto = analysisXmlServiceImpl.analysisXml("file:\\D:\\workspace\\toolkit"
                                                                       + "\\linuxShell\\src\\main\\resources\\demo.xml");
        LinuxLinkService linuxLinkService = new LinuxLinkServiceImpl();
        Response<String> response = linuxLinkService.executeCommand(commandDto);
        System.out.println(response.getResult());
    }
}
